{% extends "base.html" %}
{% block pagetitle %}提交信息{% endblock %}
{% block content %}
{% if is_admin %} 
    <div class="snapshot-box">
    <h1>Snapshots <a target=_blank href=/onebox> [ see live snapshot feed ]</a> </h1>
    <form action="/setsnapshot" method="post">
    {% for snapshot in snapshots %}
      {% if snapshot.live %}
        <div class="snapshot-live"> <b>Live:</b>
      {% else %}
        <div class="snapshot"> 
          <input name="snapshot" value="{{snapshot.key }}" type="radio" /> 
      {% endif %}
          Creation time: {{snapshot.creation_time}} 
          Num entries: {{snapshot.num_entries}}
          State: {{snapshot.state}}
      </div>
    {% endfor %}
      <input name="new" type="submit" value="New" />
      <input name="live" type="submit" value="Set Live" />
      <input name="delete" type="submit" value="Delete" />
    </form>
    <br>
    </div>

    <p>
    <form action="/insert" method="post">
     	<p>姓名：<input type="text" name="name"></input>
     	<p>性别：<input type="text" name="sex"></input>
     	<p>年龄：<input type="text" name="age"></input>
     	<p>联系电话：<input type="text" name="contact"></input>
     	<p>家庭住址：<input type="text" name="address"></input> 
     	<p>单位：<input type="text" name="unit"></input>
     	<p>受伤情况：<input type="text" name="status"></input>
     	<p>其他补充信息：<input type="text" name="other"></input>
     	<p>医院：<input type="text" name="hospital"></input> 
     	<p>科室：<input type="text" name="section"></input>
     	<p>医院联系电话：<input type="text" name="hospital_contact"></input> 
     	<p>来源：<input type="text" name="source"></input>
        <p><input type="submit" value="提交">
    </form>
    <p>
    <hr>

    {% include "persons_table.html" %}

    <br>
    {% if show_prev %}
      <a href=/admin?start={{prev}}> &lt;&lt;上一页 </a> 
    {% endif %}
    {% if show_next %}
      &nbsp;&nbsp;<a href=/admin?start={{next}}> 下一页&gt;&gt; </a>
    {% endif %}
{% else %}
  <p> Please login as admin. 
{% endif %} 
{% endblock %}
